<h1>Report Jaringan</h1>
<?php
$this->renderPartial('application.modules.member.views.main.info');

?>
<br />
<h2>Jaringan Manager Board</h2>
<strong><i>Akumulasi sponsor Cycle Manager : </i> <?php echo $akumulasi_sponsor;?></strong>
<br />    
<div class="list">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th width="10">No.</th>
            <th width="80">#ID Class</th>
            <th>ID Member</th>
            <th width="10">Posisi Level</th>
            <th width="10">Jumlah Sponsor</th>
            <th width="10">Jumlah Cycle</th>
            <th width="50">Geneologi</th>
        </tr>
        <?php
        if ($board_network) {
            $no = 1;
            foreach ($board_network as $id => $row_network) {
                $board_manager = vo_network::get_board_active(1, $row_network['board_network_id']);
                $sponsor_count = vo_network::get_board_sponsor_count($row_network['board_network_id']);
                $roll_count = vo_network::get_board_roll_count($row_network['board_network_id']);

                if ($board_manager) {
                    foreach ($board_manager as $row_manager) {
                        $arr_board_group = explode(" | ", trim($row_manager['board_network_group']));
                        $network_group_order = array_search($row_network['board_network_id'], $arr_board_group);
                        $network_group_order++;
                        $level = function_lib::get_level($network_group_order);
                        $top_mid = vo_network::get_board_network_mid($row_manager['board_leader_board_network_id']);

                        echo '<tr>';
                        echo '<td align="right">' . $no . '.</td>';
                        echo '<td align="center">#' . $row_manager['board_id'] . '</td>';
                        echo '<td align="center">' . $row_network['board_network_network_mid'] . '</td>';
                        echo '<td align="center">' . $level . '</td>';
                        echo '<td align="center">' . $sponsor_count . '</td>';
                        echo '<td align="center">' . $roll_count . '</td>';
                        echo '<td align="center"><a href="' . Yii::app()->getBaseUrl() . '/member/board/geneology/active/' . $row_network['board_network_network_mid']. '/1">Geneologi</a></td>';
                        echo '</tr>';
                        $no++;
                    }
                }
            }
        } else {
            echo '<tr><td colspan="7" align="center">-----====-----</td></tr>';
        }
        ?>
    </table>
</div>
<small><i>Note :<br />
Akumulasi sponsor adalah total member factory yang disponsori dijaringan board <br />
Jumlah Sponsor adalah jumlah member yang disponsori pada 1 board yang aktif
</i></small>
<br />
<br />
<h2>Jaringan Director Board</h2>
<div class="list">
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th width="10">No.</th>
            <th width="80">#ID Class</th>
            <th>ID Member</th>
            <th width="10">Posisi Level</th>
            <th width="10">Jumlah Sponsor</th>
            <th width="10">Jumlah Cycle</th>
            <th width="50">Geneologi</th>
        </tr>
        <?php
        if ($board_network) {
            $no = 1;
            foreach ($board_network as $id => $row_network) {
                $board_director = vo_network::get_board_active(2, $row_network['board_network_id']);
                $sponsor_count = vo_network::get_board_sponsor_count($row_network['board_network_id']);
                $roll_count = vo_network::get_board_roll_count($row_network['board_network_id']);

                if ($board_director) {
                    foreach ($board_director as $row_director) {
                        $arr_board_group = explode(" | ", $row_director['board_network_group']);
                        $network_group_order = array_search($row_network['board_network_id'], $arr_board_group);
                        $network_group_order++;
                        $level = function_lib::get_level($network_group_order);
                        $top_mid = vo_network::get_board_network_mid($row_director['board_leader_board_network_id']);

                        echo '<tr>';
                        echo '<td align="right">' . $no . '.</td>';
                        echo '<td align="center">#' . $row_director['board_id'] . '</td>';
                        echo '<td align="center">' . $row_network['board_network_network_mid'] . '</td>';
                        echo '<td align="center">' . $level . '</td>';
                        echo '<td align="center">' . $sponsor_count . '</td>';
                        echo '<td align="center">' . $roll_count . '</td>';
                        echo '<td align="center"><a href="' . Yii::app()->getBaseUrl() . '/member/board/geneology/active/' . $row_network['board_network_network_mid'] . '/2">Geneologi</a></td>';
                        echo '</tr>';
                        $no++;
                    }
                }
            }
        } else {
            echo '<tr><td colspan="7" align="center">-----====-----</td></tr>';
        }
        ?>
    </table>
</div>